<?php

defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * Admin controller for the users module
 *
 * @author 		Phil Sturgeon - PyroCMS Dev Team
 * @package 	PyroCMS
 * @subpackage 	Users module
 * @category	Modules
 */
class Admin extends UserStore_Controller {

    /**
     * Constructor method
     * @access public
     * @return void
     */
    public function __construct() {
        // Call the parent's constructor method
        parent::__construct();
        $this->load->library('categories_lib');
        $this->load->model('users/users_m');
        $this->session->set_userdata('shop_name', $this->uri->segment(1));
    }

    function index() {
        $this->category_list();
    }

    function category_list() {
        $user_id = $this->user_profile->user_id;
        $this->data['root_id'] = $this->shop_info->estore_category_id;
        $this->data['module_title'] = 'Category List';
        $this->template
                ->title('Categories manage')
                ->set_hook('TOOLBAR', 'toolbar_test1')
                ->build('admin/listing', $this->data);
    }

    function json_category_data() {
        $cat_tree = $this->categories_lib->build_shop_category_tree($this->shop_info->estore_category_id);
        print_r($cat_tree);
    }
    function hello($name){
        echo $name;
    }

}